<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 合作信息数据表
 *
 * Date: 19/03/2018
 * @author George
 */
class CreateConsociationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('consociations', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('initiator')->index()->comment('发起公司ID');
            $table->unsignedInteger('partner')->index()->comment('合作公司ID');
            $table->string('type')->comment('合作类型');
            $table->unsignedInteger('project_id')->index()->comment('项目ID');
            $table->string('buttman')->comment('负责人');
            $table->string('contact')->comment('联系方式');
            $table->date('start')->comment('开始日期');
            $table->date('deadline')->comment('截止日期');
            $table->json('permissions')->comment('开放权限');
            $table->string('status')->comment('状态');
            $table->string('comment')->comment('说明');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('consociations');
    }
}
